home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
os2
/
rexxcolr.zip
/
COLOR.CMD
Wrap
OS/2 REXX Batch file
|
1992-09-15
|
5KB
|
111 lines
/*>>>>>>>>>>>>>>>>>>>>>> REXX/2 COLOR.CMD <<<<<<<<<<<<<<<<<<<<<<<<<*//*
After switching to OS/2, I found myself missing the convenience of ansi.sys
and decided to replace some of my batch files with REXX files. This is my
first attempt. Wish I had something more than just the online info. Oh well!
Minimal to non-existant error checking. No provision for an Environment
variable to maintain color selection between "cmd" files.
You may enter only the FG color at any prompt, & it will give you that
foreground color with the default background - black.
Doubt this is necessary, but... ANSI should be ON.
There is probably a better & more REXX-like way to do this but.....
I am not responsible for damage that might result from improper use or misuse
of this file.
Paul Smith
Catfish Bend BBS
319-752-0953 */
/*------------------------[ Code Starts Next Line ]---------------------------*/
'@echo off'
CALL RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
CALL SysLoadFuncs
ARG fg bg
IF fg <> "" THEN /* see if 2 commandline args */
DO /* no check for improper args */
IF bg ='' then bg=0 /* Lazy people get black background */
IF fg > 15 | bg > 7 then SIGNAL Menu /* Serious help needed here */
IF fg > 7 THEN /* High intensity required */
SAY ""fg-8+30";"bg+40"m"
ELSE /* Normal intensity indicated */
SAY""fg+30";"bg+40"m"
CALL SYSDROPFUNCS
CLS; EXIT /* Colors set so exit */
END /* Last chance to get it right */
MENU:
CALL SysCurState OFF
SAY""; CLS; fg=29; hfg=29; Row=12; col=4; bg=40 /* Default color & set variables */
SAY"
> ╥─╖ ╓── ╖ ╓ ╖ ╓ ╓─╖ ╓── ╓─╥─╖ ╓─╖ ╓─╖ ╥ ╓─╖ ╥─╖ ╓─╖ <"
SAY"> ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ <"
SAY"> ╟─╜ ╟─ ╙─╖ ╙─╖ ╙─╖ ╟─ ║ ─── ║ ║ ║ ║ ║ ║ ╟─╜ ╙─╖ <"
SAY"> ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ <"
SAY"> ╨ ╙ ╙── ╜ ╙ ╜ ╙ ╙─╜ ╙── ╨ ╙─╜ ╙─╜ ╙── ╙─╜ ╨ ╙ ╙─╜ <
"
SAY
SAY
SAY" F O R E G R O U N D"
SAY
SAY"
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
SAY"
B
"
SAY"
A
0 "
SAY"
C
1 "
SAY"
K
2 "
SAY"
G
3 "
SAY"
R
4 "
SAY"
O
5 "
SAY"
U
6 "
SAY"
N
7 "
SAY"
D
"
DO 8 /* Paint low intensity colors */
DO 8
fg=fg+1; col=col+4; SAY""row";"col"H"fg";"bg"mIBM "
END
DO 8 /* Paint high intensity colors */
hfg=hfg+1; col=col+4; SAY""row";"col"H"hfg";"bg"mIBM "
END
bg =bg+1; row=row+1; col=4; fg=29; hfg=29 /* reset variables */
END
SAY"H
Enter color selection as in [FG BG] Where FG is the foreground color "
SAY" and BG is the background color. There must be a space between FG BG. H"
SAY"
"
CALL SysCurState ON /* Turn cursor back on */
PULL FG BG /* Get user choices */
IF fg='' & bg='' THEN /* No Choices entered so */
DO
SIGNAL Menu /* Menu needed here */
END
IF fg > 15 | bg > 7 THEN /* Clown Check & Exit */
DO
SIGNAL Menu
END
IF BG='' THEN BG=0 /* Lazy man's black Backgroung */
IF fg > 7 THEN
DO
SAY ""fg-8+30";"bg+40"m" /* Choices entered so act */
END
ELSE
SAY""FG+30";"BG+40"m"
CLS /* Colorize screen & clear */
CALL SYSDROPFUNCS